﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PPIDesktopClient.Entities;
using System.Data;
using PPIDesktopClient.General;
using PPIProxy;
using VMind.Global;

namespace PPIDesktopClient.Logic
{
    public class LXMissionStructures_PoleTopType
    {
        public static List<EXMissionStructures_PoleTopType> SelectAllIdName(DataTable dt)
        {
            List<EXMissionStructures_PoleTopType> _XMissionStructures_PoleTopTypeList = new List<EXMissionStructures_PoleTopType>();
            EXMissionStructures_PoleTopType _XMissionStructures_PoleTopType;

            foreach (DataRow  dr in dt.Rows)
            {
                _XMissionStructures_PoleTopType = new EXMissionStructures_PoleTopType(ConvertHelper.ToInt32(dr["XMissionStructures_PoleTopTypeId"]),dr["Name"].ToString());
                _XMissionStructures_PoleTopTypeList.Add(_XMissionStructures_PoleTopType);
            }
            return _XMissionStructures_PoleTopTypeList;
        }

        public static List<EXMissionStructures_PoleTopType> SelectAllIdName()
        {
            ConfigReader _Reader = ConfigReader.GetInstance();
            DataTable dt = WXMissionStructures_PoleTopType.SelectAllIdName(_Reader.GetConnectionString()).Tables[0];
            return SelectAllIdName(dt);

        }
    }
}
